package org.mzyyn.qr.service.impl;

import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.mzyyn.qr.entity.AppManagerPO;
import org.mzyyn.qr.mapper.AppManagerMapper;
import org.mzyyn.qr.service.AppManagerService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.qr.xiaocao.common.constants.DeletedStatusEnum;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 应用管理  服务实现类
 * </p>
 *
 * @author lipeng
 * @since 2024-09-03
 */
@Service
public class AppManagerServiceImpl extends ServiceImpl<AppManagerMapper, AppManagerPO> implements AppManagerService {

    @Override
    public AppManagerPO getAppManagerByAppId(String appId) {
        if (StrUtil.isEmpty(appId)) {
            return null;
        }
        LambdaQueryWrapper<AppManagerPO> query = new LambdaQueryWrapper<>();
        query.eq(AppManagerPO::getAppid, appId);
        query.eq(AppManagerPO::getDeleted, DeletedStatusEnum.NOTDELETE.getCode());
        return this.baseMapper.selectOne(query);
    }
}
